/*
 * @Descripttion: 合同单据
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-04-25 12:11:55
 * @LastEditors: GW
 * @LastEditTime: 2021-12-14 11:03:03
 */
import { axios } from '../../utils/request'

const api = {
    save: '/cm/contract/save',
    examine: '/cm/contract/examine',
    delete: '/cm/contract/delete',
    getcode: '/cm/contract/getCode',
    getdetails: '/cm/contract/getDetail',

    changeSave: '/cm/contract/changeContract',//合同变更保存
    changeList: '/cm/contract/getChangeList',//变更记录列表
    changeDetails: '/cm/contract/getChangeDetail',//变更后的明细数据
}

/**
 * 保存
 */
export function save (data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}

/**
 * 审核
 */
export function examine (data) {
    return axios({
        url: api.examine,
        method: "get",
        params: data
    })
}

/**
 * 删除
 */
export function remove (data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 获取单据编号
 */
export function getCode (data) {
    return axios({
        url: api.getcode,
        method: "get",
        params: data
    })
}

/**
 * 获取合同明细
 */
export function getDetails (data) {
    return axios({
        url: api.getdetails,
        method: "get",
        params: data
    })
}

/**
 * 合同变更保存
 */
export function changeSave (data) {
    return axios({
        url: api.changeSave,
        method: "post",
        data: data
    })
}

/**
 * 变更记录列表
 */
export function changeList (data) {
    return axios({
        url: api.changeList,
        method: "get",
        params: data
    })
}

/**
 * 获取变更后的明细
 */
export function changeDetails (data) {
    return axios({
        url: api.changeDetails,
        method: "get",
        params: data
    })
}

